package  
{
	import flash.display.MovieClip;
	import flash.events.Event;
	import flash.events.TimerEvent;
	import flash.utils.Timer;
	/**
	 * ...
	 * @author ...
	 */
	public class FadaAzul extends Faerie
	{
		private var direction :int = 1;
		private var timFaerieAnimation : Timer = new Timer(280);
		
		
		public var newDirection:int;
		
		public function FadaAzul(posX:Number,posY:Number) 
		{		
			timFaerieAnimation.addEventListener(TimerEvent.TIMER, FaerieAnimation);
			this.x = posX;
			this.y = posY;
			
		}
		
		override public function updateFaeriePosition(player : MovieClip):void 
		{		
			this.y = player.y - player.height / 2 - this.height / 2 - 7;
			
			if (player.direction == 1)
			{
				(this.x = player.x - player.width / 2 - this.width / 2+40 );
			}
			else
			{
				this.x = player.x - player.width / 2 + this.width / 2 - 40;
			}				
		}
		
		public function FaerieAnimation(e:TimerEvent)
		{
			
			this.y += Math.random();
			this.x += Math.random()*3;
		}
		
	}

}